package com.yygo.webapp.controller.loanrequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by tiansha on 2015/7/29.
 */
@Controller
@RequestMapping("/backToCA")
public class BackToCAController extends BaseLoanRequestFormController {

    /*@RequestMapping(method = RequestMethod.GET)
    public String transferCA(@RequestParam(required = true, value = "reqId") Long reqId, Principal principal, HttpServletRequest request) throws Exception{
        LoanRequest loanRequest = loanRequestManager.loadWholeLoanRequest(reqId);
        User loginUser = userManager.getUserByUsername(principal.getName());
        if (!loginUser.hasRole(Constants.SCA_ROLE)) {
            throw new AccessDeniedException("You have no right to transfer back to CA");
        }
        loanRequest.setSendback(true);
        User auditUser = getHistoryUser(loanRequest, Constants.CA_ROLE);
        transferStatus(loanRequest, RequestStatus.request_audit, Phase.ca_audit, auditUser, request.getLocale(), loginUser, Constants.SCA_ROLE);
        loanRequestManager.saveLoanRequest(loanRequest);

        return "redirect:/loanRequestform?reqId=" + loanRequest.getId();
    }*/


}
